

/**
 * 获取缓存 
 * @param  {[type]} k   [键名]
 * @param  {[type]} def [获取为空时默认]
 */
function get(k, def) {
    var deadtime = parseInt(localStorage.getItem(k + postfix))
    if (deadtime) {
        if (parseInt(deadtime) < Date.parse(new Date()) / 1000) {
            if (def) {
                return def;
            } else {
                return false;
            }
        }
    }
    var res = localStorage.getItem(k);
    if (res) {
        return res;
    } else {
        if (def == undefined || def == "") {
            def = false;
        }
        return def;
    }
}


module.exports = {
    get: get,
}